import Vue from 'vue'
import App from './App.vue'
/*路由*/
import router from './router';
/*elementUi*/
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
//vxe
import VXETable from 'vxe-table';
import 'vxe-table/lib/style.css';
import VXEPcUI from 'vxe-pc-ui';
import 'vxe-pc-ui/lib/style.css';

import 'font-awesome/css/font-awesome.min.css'
// vuex
import store from "@/store";

async function initApp() {
    // 1. 从本地存储获取Token
    const token = localStorage.getItem('token');
    if (!token) {
        window.location.href = '/login';
    }
}

Vue.config.productionTip = false

Vue.use(ElementUI);
Vue.use(VXETable);
Vue.use(VXEPcUI);

new Vue({
    render: h => h(App),
    router,
    store
}).$mount('#app')

initApp();
